This is both a blatant attempt at Huxterism and a service to those who bought the book The Viewport Technician, a Guide To Portable Software Design. As printed in the current edition, the table of contents does not go down as many levels of detail as I believe it should. Although there is an index, I decided to kill three birds with an electronically guided rock by uploading this more complete form of the TOC.
The third reason for which I uploaded this file is to plead for corrections. You can help improve later printings with your feedback. If you spot any unobvious (to me) or irritating (to you) glitches, let me know electronically. Anything goes, including typos ("dissociated" is not as good as "disassociated") and event loop lore (i.e. there's WaitNextEvent now, besides GetNextEvent). The things that are hardest for me to track down alone are the changes that obsolete parts of the book, because that means continually tracking updates to a number of different operating environments, a tedious/time consuming effort. Your thoughts in general are appreciated, pro or con.
If you have, or know of, a commercial or public domain product that supports portable development, a new or updated CASE system, or the release of a new portable environment (the EPS port of Sun's NeWS for the Macintosh, etc etc. for example), feel free to send the information to me, and I will (publisher permitting) attempt to incorporate the information into later printings or editions. The Viewport Technician is targeted toward commercial development for what are essentially store-bought personal computers, and as such does not (except peripherally) discuss anything except readily available product. Trust me when I write that there is PLENTY of material to cover, just on stuff that currently exists.
The Essentials:
INTRODUCTION
OBJECTIVES
ACKNOWLEDGEMENTS
PART I Overview
PART II Program Organization
PART III Environment Services
PART IV Program Orchestration
EPILOG
APPENDICES
GLOSSARY
INDEX
In Greater Detail:
Part I: Overview
1 The New Assignment 3
2 Analyzing What's Needed 4
3 The Services of a Window System 5
4 A Short Description of the Machines 9
1 Apple Macintosh 10
2 IBM PC Family 11
3 Atari ST 13
4 Commodore Amiga 14
5 Apple ][GS 16
5 Conclusion 18
Part II: Program Organization
1 Introduction 21
2 Program Composition 22
1 Response Time and Responsibility 22
1 Simple Non-Real-time User I/O 23
2 A Non-Real-Time Example 23
3 Real-Time User I/O 23
4 A Real-Time Example 24
2 Displays and Display Objects 25
1 The Display 26
2 The Use for a Window 27
3 Appearance -vs- Editing Rules 28
4 Active Objects Objects 29
5 Dialog Windows 30
6 Menus 31
7 User Behavior 31
8 Under The Hood 32
3 Modes 34
4 Events and the Event Loop 36
5 Event Loop Portability 45
6 Initialization and Cleanup 47
7 Executable File (Runtime) Organization 53
1 Files and Resources 54
2 Resources 56
8 System Dependent (Pre-Compile) Files 58
3 Source File Organization 64
1 The Language Show 64
2 Handling Code Differences 66
1 Runtime Conditionals 66
2 Runtime Initialization and Prompting 67
3 Preprocessor Conditionals 67
4 Link-time Decisions 68
5 Overlays 69
3 Include Files 69
1 Nested Includes 71
2 A Full-Fledged Pascal Example 72
3 Caveats 72
4 Portable Pascal Code 74
4 Independent Compilation 75
5 Separate Compilation 76
6 Preprocessors and Macros 78
1 Introduction 78
2 FORTRAN 78
3 cpp 79
4 An Example 80
5 Modula 2 81
6 Macros 82
7 Preprocessor Difficulties 82
7 Overlays and Chaining 83
8 Modules and Units in Pascal 88
1 In General 88
2 Turbo Pascal for the IBM PC 89
3 Pascal/MT+ 90
4 Microsoft Pascal 92
5 UCSD Pascal 94
6 Lisa Pascal (etc etc etc etc) 96
7 Separate Compilation in Modula 2 97
8 Independent Compilation in C 100
9 Automating File and Program Construction 102
1 Program 1: The Make Utility 102
2 A Special Trick: Source File ID 104
Strings in Binary Files
3 Program 2: The Code Vault 105
10 Portable Pascal Using Preprocessors 107
1 Defining The Problem 107
2 Problems With Macros 109
3 The Portable Pascal Example 110
4 Coding Hints 137
1 The Pascal Minor Arcana 139
1 Naming Conventions 139
2 Lengths of Names 139
3 Labels 140
4 Modula-2 Considerations 141
5 Reserved Words 141
6 Archaic Syntactical Differences 141
7 Pascal Constants 141
8 Pascal Types 143
9 Predefined String Functions 147
10 Predefined Constants 148
11 Declaration Order in a Program Block 148
12 Data Type Conversion 149
13 Storage, Stack Allocation and 151
14 Pointers
15 Pointer Expressions 153
16 PC Turbo Pascal Pointers 153
17 Turbo Pascal/Macintosh Address Of 154
18 Operator
19 TML Pascal Pointers 154
20 Pascal/MT+ 154
21 Microsoft MS-Pascal Pointers 155
22 MS-Pascal Pointer Types 155
23 MS-Pascal Data Allocation 155
24 Conclusions 156
25 Pointer Validity 156
26 Absolute Addresses 157
27 Control Flow 157
28 Redeclaration of Identifiers in 158
One Scope
29 Interrupt Routines and Events 158
30 Two Flavors of the Keyword Inline 159
31 Conformant Arrays and 161
Functions as Parameters
32 Get and Put 161
2 The C Minor Arcana 162
1 Overview 162
2 C Portability Dont's 163
3 Some Do's of Software Portability 168
4 Limits 172
Part III: Environment Services
1 Introduction 175
2 Foundations 176
1 The Runtime Interface 176
1 A Gem Roadmap 176
2 A Microsoft Windows Roadmap 182
3 A Macintosh Roadmap 184
4 A ][GS Roadmap 187
5 An Amiga Roadmap 188
6 Calling Standards 189
2 Primitive Datatypes 191
1 Macintosh, MS Windows, Gem, and 191
Amiga datatypes
2 Extended Pascal -vs- C Strings 194
3 Handles and Pointers 195
1 Macintosh 196
2 Gem 196
3 Type Casts and Generic Pointers 197
3 Event Managers 200
1 Overview 201
2 Mouse Buttons 202
3 Recommendations 202
4 Event Data Structures 203
5 Event Queues 208
6 Receiving Events and Messages 211
7 Keyboard Events 214
8 Mouse Events 217
9 Device Driver Events 219
10 Event Priorities 220
4 Graphics 221
1 Using the Graphics Library 221
1 Macintosh
1 Quickdraw in ROM 222
2 Pascal Calling Standards 222
3 Assembly Concerns 222
4 External Declarations 223
2 Gem 224
3 MS Windows 224
1 Assembly Conventions 225
4 ][GS 226
5 Amiga 226
1 Assembler Concerns 227
2 Coordinate Systems 227
3 The Point 244
4 Fundamental, Modal, and Temporal Concerns 248
5 The Line 250
6 The Pen 254
7 Drawing Modes 257
8 The Rectangle (and Friends) 261
9 Complicated Rectangle Operations 264
10 The Region 266
11 Pattern Fills 274
12 Polygons 281
13 Circles, Ellipses, Curves, and Arcs 285
14 Clipping 287
15 List of Primitives 293
16 Color 295
17 Bitmaps 303
18 The Cursor 324
19 Data Structures 329
20 Extending and Interchanging Code 354
21 Low-Level Text Support 362
22 Miscellaneous Graphics Support Routines 371
23 Mapping Routines 373
24 Specialized Processor Control 375
25 Animation 378
5 Windows and Their Managers 389
1 Distinctions 389
2 Vocabulary 390
3 Windows and Multitasking 395
4 Screens -vs- Tiled Windows 396
5 Window Management Initialization 399
6 Window type Registration, Creation 400
7 Predefined Window Types 402
8 Visible Data Structures 409
9 Displaying a Window 417
10 Window Adjustments 418
11 Miscellaneous Routines 419
12 Window Dynamics 420
13 Closing a Window 422
14 Dragging a Window 423
15 Adjusting the Size of a Window 424
16 Drawing the Contents of a Window 426
17 Drawing/Painting Support Routines 427
1 Macintosh 427
2 Gem 427
3 MS Windows 428
1 Update List Control Routines 428
2 Display Contexts (DCs) 429
3 Area and Region Marking 430
18 Window Shutdown 430
19 Accessing the Fields of Window Data Records 431
20 Extensibility 432
21 Multitasking and Task Switching 433
22 Conclusions 435
6 Menus 436
1 Command Input Methods 436
2 Jounalling and Macro Packages 437
3 Digression on Command Input Design 438
4 Design Constraints 439
5 Menu Composition 440
6 Common Roots and Subtle Differences 442
7 Displaying Menus 444
8 Creating and Redefining Menu Items 445
9 The Menu Bar 458
10 Manipulating the Desk Accessory Menus 461
11 Menu Initialization, Setup, and Takedown 462
12 Advanced Menu Building Routines 464
13 Menu Utility Routines 465
14 Special Effects 466
15 Menu Data Structures 467
16 Controlling Menu Feedback 469
7 On the Dialog, Form, Requester, and Alert 469
1 What They Are 469
2 Modal -vs- NonModal Dialogs 470
3 Data Structures 473
4 Dialog Management Initialization and Termination 476
5 Dialog (and Alert) Creation and Disposal 477
6 Dialog Resource Definition 481
7 Dialog Display 484
8 Dialog Manipulation 487
9 Dialog Item Manipulation 488
10 Dialog Sound Support 492
11 Dialog Interaction 493
12 Miscellaneous Routines 494
13 Dialog Extensions 495
8 Controls, Gadgets, and Icons 497
1 Overview 498
1 Using Controls 498
2 Learning Safely 498
3 General Types 499
2 Window Controls 499
3 Dialog and Alert Controls 506
4 Control Routines and Data Structures 513
5 Synopsis 519
9 Advanced Text Editing Support 526
10 Resources 533
1 Resource Compilers and Editors 533
2 Decompilers 534
3 Predefined Resource Types 534
4 Window System Resource Support 539
Part IV: Program Orchestration
1 Methods and Automation 549
1 What is a Good Idea? 549
2 Prototyping 550
3 Communication and Memory 551
1 OK, How? By Capturing Connectivity
4 Words and Pictures 552
1 DataFlow Diagrams 552
2 Nassi-Shneiderman Charts 560
3 Structure Charts 562
4 Very Briefly, Warnier-Orr 566
5 Examples of Automated Development Steps 567
6 Computer-Aided Software Design Packages 570
7 Hybrid Systems 572
8 Summary 572
EPILOG: Disguising Nondescript Positions, States, and 574